package model;

import java.io.File;
import java.awt.Point;

public interface TockConstants {
	// debug codes
	public static final boolean DEBUG_DEALING = false;
	public static final boolean DEBUG_LISTENER = false;
	public static final boolean DEBUG_MOVE_GENERATION = false;
	public static final boolean DEBUG_NETWORK = false;
	
	// if we're stacking the deck for debugging
	public static final boolean STACK_DECK = false;
	
	// version numbers
	public static final double VERSION = 1.0;
	
	// Port that the server runs on
	public static final int SERVER_PORT = 36963;
	
	// How often should the client update
	public static final int UPDATE_FREQ = 3000;
	
	// How many games allowed on the server
	public static final int MAX_GAMES = 10;
	
	// colours...yes, colours not colors. I'm from Canada and proud of it ;)
	public static final int RED = 0;
	public static final int BLUE = 1;
	public static final int GREEN = 2;
	public static final int BLACK = 3;
	
	// types of location
	public static final int LOC_TYPE_NORMAL = 0;
	public static final int LOC_TYPE_START = 1;
	public static final int LOC_TYPE_HOME = 2;
	
	// types of moves
	public static final int MOVE_TYPE_NORMAL = 0;
	public static final int MOVE_TYPE_TOCK = 1;
	public static final int MOVE_TYPE_SWITCH = 2;
	public static final int MOVE_TYPE_SELF_TOCK = 3;
	
	// types of move packets
	public static final int MOVE_PACKET_TYPE_NORMAL = 0;
	public static final int MOVE_PACKET_TYPE_TEN_SWITCH = 1;
	public static final int MOVE_PACKET_TYPE_SEVEN_PARTIAL = 2;
	public static final int MOVE_PACKET_TYPE_DISCARD = 3;
	
	// move errors
	public static final int MOVE_ERROR_NONE = 0;
	public static final int MOVE_ERROR_NOT_STARTED = 1;
	public static final int MOVE_ERROR_NOT_TURN = 2;
	public static final int MOVE_ERROR_NOT_PIECE = 3;
	public static final int MOVE_ERROR_INVALID_MOVE = 4;
	
	// create game errors
	public static final int CREATE_GAME_ERROR_NONE = 0;
	public static final int CREATE_GAME_ERROR_NAME = 1;
	public static final int CREATE_GAME_ERROR_PLAYERS = 2;
	public static final int CREATE_GAME_ERROR_FULL = 3;
	
	// file name for the target image
	public static final String TARGET_IMAGE = 
		("." + File.separator + "media" + File.separator + "Target.gif");
	
	// file names of all the marble images
	public static final String[] MARBLE_IMAGE = {
		("." + File.separator + "media" + File.separator + "Marbles" + File.separator + "RedBall.gif"),
		("." + File.separator + "media" + File.separator + "Marbles" + File.separator + "BlueBall.gif"),
		("." + File.separator + "media" + File.separator + "Marbles" + File.separator + "GreenBall.gif"),
		("." + File.separator + "media" + File.separator + "Marbles" + File.separator + "BlackBall.gif")};
	public static final String[] MARBLE_IMAGE_ALT = {
		("." + File.separator + "media" + File.separator + "Marbles" + File.separator + "RedBallAlt.gif"),
		("." + File.separator + "media" + File.separator + "Marbles" + File.separator + "BlueBallAlt.gif"),
		("." + File.separator + "media" + File.separator + "Marbles" + File.separator + "GreenBallAlt.gif"),
		("." + File.separator + "media" + File.separator + "Marbles" + File.separator + "BlackBallAlt.gif")};
	
	// spots where you start playing from
	public static final int[] COME_OUT_SPOTS = {0, 18, 36, 54};
	
	// spots where the marble is safe from tocking
	public static final int[] SAFE_SPOTS = {8, 26, 44, 62};
	
	// board locations of the players depending on how many players there are
	public static final int[][] BOARD_LOCATIONS = {{0},
		{0},
		{0, 2},
		{0, 2, 3},
		{0, 1, 2, 3}};
	
	// starting spots for all of the marbles
	public static final Point[][] START_SPOTS = {
		{(new Point (161, 308)), (new Point (191, 301)), (new Point (173, 290)), (new Point (151, 289))},
		{(new Point (81, 113)), (new Point (94, 103)), (new Point (99, 92)), (new Point (79, 99))},
		{(new Point (301, 39)), (new Point (315, 45)), (new Point (320, 36)), (new Point (330, 46))},
		{(new Point (439, 209)), (new Point (439, 194)), (new Point (446, 182)), (new Point (457, 199))}};
	
	// home spots for all of the marbles
	public static final Point[][] HOME_SPOTS = {
		{(new Point (320, 249)), (new Point (311, 234)), (new Point (301, 218)), (new Point (292, 203))},
		{(new Point (115, 188)), (new Point (135, 182)), (new Point (154, 176)), (new Point (173, 171))},
		{(new Point (208, 66)), (new Point (213, 75)), (new Point (219, 85)), (new Point (225, 95))},
		{(new Point (381, 108)), (new Point (365, 113)), (new Point (349, 118)), (new Point (334, 123))}};
	
	// normal spots for all of the marbles
	public static final Point[] NORMAL_SPOTS = {
		(new Point(312, 273)),
		(new Point (294, 279)),
		(new Point (294, 263)),
		(new Point (290, 247)),
		(new Point (282, 232)),
		(new Point (272, 220)),
		(new Point (258, 210)),
		(new Point (243, 201)),
		(new Point (227, 195)),
		(new Point (210, 191)),
		(new Point (193, 190)),
		(new Point (173, 190)),
		(new Point (156, 194)),
		(new Point (137, 200)),
		(new Point (120, 208)),
		(new Point (103, 220)),
		(new Point (98, 207)),
		(new Point (93, 194)),
		(new Point (89, 181)),
		(new Point (85, 171)),
		(new Point (104, 170)),
		(new Point (122, 167)),
		(new Point (139, 163)),
		(new Point (156, 156)),
		(new Point (170, 148)),
		(new Point (182, 138)),
		(new Point (191, 128)),
		(new Point (198, 118)),
		(new Point (200, 108)),
		(new Point (201, 97)),
		(new Point (198, 88)),
		(new Point (193, 79)),
		(new Point (184, 71)),
		(new Point (172, 63)),
		(new Point (187, 60)),
		(new Point (201, 56)),
		(new Point (216, 52)),
		(new Point (229, 49)),
		(new Point (228, 58)),
		(new Point (231, 67)),
		(new Point (236, 76)),
		(new Point (245, 84)),
		(new Point (255, 91)),
		(new Point (267, 98)),
		(new Point (282, 103)),
		(new Point (298, 105)),
		(new Point (314, 107)),
		(new Point (329, 106)),
		(new Point (344, 104)),
		(new Point (358, 100)),
		(new Point (370, 93)),
		(new Point (381, 86)),
		(new Point (388, 95)),
		(new Point (396, 104)),
		(new Point (405, 114)),
		(new Point (413, 123)),
		(new Point (397, 123)),
		(new Point (380, 125)),
		(new Point (366, 129)),
		(new Point (353, 136)),
		(new Point (341, 143)),
		(new Point (332, 153)),
		(new Point (324, 164)),
		(new Point (320, 176)),
		(new Point (319, 188)),
		(new Point (321, 202)),
		(new Point (326, 215)),
		(new Point (336, 229)),
		(new Point (349, 242)),
		(new Point (365, 253)),
		(new Point (348, 259)),
		(new Point (331, 266))};
	
	// number of cards to deal for each hand, depending on the number of players there are
	public static final int[][] HAND_VALUES = {{0},
		{4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
		{5, 5, 4, 4, 4, 4},
		{5, 4, 4, 4},
		{5, 4, 4}};
	
	// file names of the card backings
	public static final String[] CARD_BACKS = {
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "back1.jpg")
	};
	
	// file names of the turn indicators and the 4 locations
	public static final String[] TURN_INDICATORS = {
		("." + File.separator + "media" + File.separator + "turn_ind_1.png")
	};
	public static final int[][] TURN_INDICATOR_LOCS = { {188, 238}, {133, 103}, {293,58}, {388,178} };
	
	// random graphics
	public static final String EXIT_ICON = ("." + File.separator + "media" + File.separator + "exit.png");
	public static final String START_ICON = ("." + File.separator + "media" + File.separator + "start.png");
	public static final String STOP_ICON = ("." + File.separator + "media" + File.separator + "stop.png");
	public static final String CLEAR_ICON = ("." + File.separator + "media" + File.separator + "clear.png");
	public static final String SEND_ICON = ("." + File.separator + "media" + File.separator + "send.png");
	public static final String SMILE_ICON = ("." + File.separator + "media" + File.separator + "smile.png");
	
	// file names of all the card images
	public static final String[] CARD_IMAGE = {
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "c1.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "c2.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "c3.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "c4.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "c5.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "c6.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "c7.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "c8.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "c9.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "c10.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "c11.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "c12.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "c13.jpg"),
		
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "d1.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "d2.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "d3.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "d4.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "d5.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "d6.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "d7.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "d8.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "d9.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "d10.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "d11.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "d12.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "d13.jpg"),
		
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "h1.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "h2.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "h3.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "h4.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "h5.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "h6.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "h7.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "h8.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "h9.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "h10.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "h11.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "h12.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "h13.jpg"),
		
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "s1.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "s2.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "s3.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "s4.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "s5.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "s6.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "s7.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "s8.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "s9.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "s10.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "s11.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "s12.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "s13.jpg"),
		
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "j1.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "j2.jpg"),
		("." + File.separator + "media" + File.separator + "Cards" + File.separator + "j3.jpg")};
}
